home *** CD-ROM | disk | FTP | other *** search
/ The Canadian & World Encyclopedia 1998 / The Canadian & World Encyclopedia 1998 - Disc 2.iso / mac / prime_CD / pb / PROFILE.DIR / 00306_Script_helper < prev    next >
Text File  |  1997-07-29  |  3KB  |  105 lines

  1. on new me
  2.   set framestack = [:]
  3.   return me
  4. end
  5.  
  6. on plant me, chn, frm, labelTag
  7.   -- plants copies of sprite chn, frm, into chn, frm, 
  8.   -- of labels containing labelTag
  9.   go frm
  10.   
  11.   set theMemberNum = the memberNum of sprite chn
  12.   set theScriptNum = the scriptNum of sprite chn  
  13.   
  14.   set theFrameList = the labelList
  15.   delete the last char of theFrameList
  16.   
  17.   set resultList = []
  18.   
  19.   repeat while the number of lines in theFrameList > 0
  20.     set theLabel = line 1 of theFrameList
  21.     delete line 1 of theFrameList
  22.     go label(theLabel)
  23.     if theLabel contains labelTag then
  24.       beginrecording
  25.         set the memberNum of sprite chn = theMemberNum
  26.         set the scriptNum of sprite chn = theScriptNum
  27.         updateframe
  28.       endrecording
  29.       append resultList, theLabel
  30.     end if
  31.   end repeat
  32.   put "Frames updated:" & return & resultList
  33.   put the name of member theMemberNum && the name of member theScriptNum
  34.   return me
  35. end
  36.  
  37.  
  38. on standardizeMembs me -- set all members to something
  39.   set ttlLibs = the number of castlibs
  40.   repeat with currLib = 1 to ttlLibs
  41.     set ttlMembs = the number of members of castlib currLib
  42.     set libCount = 0
  43.     repeat with currMemb = 1 to ttlMembs
  44.       case the type of member currMemb of castlib currLib of
  45.           
  46.           -- member types to catch and actions to take
  47.           
  48.         #richText:
  49.           set the scrolltop of member currMemb of castlib currLib = FALSE
  50.           
  51.         #field: 
  52.           set the scrolltop of member currMemb of castlib currLib = FALSE
  53.           
  54.         #digitalVideo:
  55.           set the pausedAtStart of member currMemb of castlib currLib = TRUE 
  56.           
  57.       end case
  58.     end repeat
  59.     put "Castlib" && currLib && "processed."
  60.   end repeat
  61.   return me
  62. end
  63.  
  64.  
  65. ---- these set all the scripts in a range to a particular script
  66. on scriptBlock
  67.   repeat while not (the framelabel contains "pmw")
  68.     scriptcol
  69.   end repeat
  70. end
  71.  
  72. on scriptCol
  73.   beginrecording
  74.     repeat with i = 1 to 48
  75.       if the type of sprite i <> 0 then
  76.         set the scriptNum of sprite i to the member of member "goNextMarker" of castlib "internal"
  77.       end if
  78.     end repeat
  79.     updateframe
  80.   endrecording
  81. end
  82.  
  83. -- gather any non-ascii chars
  84. --          set oldDelim = the itemdelimiter
  85. --          set the itemdelimiter = " "
  86. --          set nonAsciiList = [:]
  87. --          set text = the text of member currMemb of castlib currLib
  88. --          repeat while text <> ""
  89. --            set theLine = line 1 of text
  90. --            repeat with ltr = 128 to 255
  91. --              set ptr = offset(numtochar(ltr), theLine)
  92. --              if ptr <> 0 then
  93. --                repeat while offset(numtochar(ltr), word 1 of theLine) = 0
  94. --                  delete word 1 of theLine
  95. --                end repeat
  96. --                setaprop nonAsciiList, charTonum(char ptr - 1 of theLine), word 1 of theLine
  97. --                delete word 1 of text
  98. --                
  99. --              end if
  100. --            end repeat
  101. --            delete line 1 of text
  102. --            
  103. --          end repeat
  104. --          set the itemdelimiter = oldDelim
  105.